﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using LayuiMvc.DataEntity.DataEntity;
using LayuiMvc.DataEntity.DataEnum;
using LayuiMvc.DataEntity.IdentityEntity;

namespace LayuiMvc.DataEntity.DataEntity
{
    /// <summary>
    /// 帖子实体类
    /// </summary>
    [Table("Post")]
    public class PostEntity
    {
        /// <summary>
        /// 帖子Id
        /// </summary>
        [Key]
        public int PostId { get; set; }

        /// <summary>
        /// 关联Guid
        /// </summary>
        public Guid RelationGuid { get; set; }

        /// <summary>
        /// 帖子标题
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// 帖子类型
        /// </summary>
        public PostTypeEnum PostType { get; set; }

        /// <summary>
        /// 帖子内容
        /// </summary>
        public string Content { get; set; }

        /// <summary>
        /// 帖子内容Html代码
        /// </summary>
        public string HtmlContent { get; set; }

        /// <summary>
        /// 发表时间
        /// </summary>
        public DateTime PublishTime { get; set; }

        /// <summary>
        /// 浏览次数
        /// </summary>
        public int ViewCount { get; set; }

        /// <summary>
        /// 发布者用户Id
        /// </summary>
        [ForeignKey("PublishUser")]
        public int PublishUserId { get; set; }

        /// <summary>
        /// 是否删除
        /// </summary>
        public bool IsDelete { get; set; }

        /// <summary>
        /// 是否置顶
        /// </summary>
        public bool IsTop { get; set; }

        /// <summary>
        /// 是否加精
        /// </summary>
        public bool IsCream { get; set; }

        /// <summary>
        /// 是否结贴
        /// </summary>
        public bool IsEnd { get; set; }

        /// <summary>
        /// 发布者用户
        /// </summary>
        public virtual IdentityUserEntity PublishUser { get; set; }

        /// <summary>
        /// 帖子回复列表
        /// </summary>
        public virtual ICollection<PostReplyEntity> Replys { get; set; }

    }
}
